<%@ page import="com.ant.myagile.backlog.Issue" %>
<<!DOCTYPE html>
<html xmlns:g="http://www.w3.org/1999/xhtml">
<head>
    <meta name="layout" content="main">
    <r:require modules="jquery, jEditable"/>
    <link rel="stylesheet" href="${resource(dir: 'css', file: 'home.css')}">
     <script src="${resource(dir: 'js', file: 'issue.js')}"></script>
    <link
            href="http://fonts.googleapis.com/css?family=Reenie+Beanie:regulbvbar"
            rel="stylesheet" type="text/css">
		<title>Create a new issue</title>
	<script type="text/javascript">
	var GET_PROJECT_BY_USER = '<g:createLink controller="Issue" action="getProjectByUser"/>';
	var GET_PROJECT_BY_PROJECT = '<g:createLink controller="Issue" action="getUserStoryByProject"/>';
	var GET_ALL_TEAMS = '<g:createLink controller="Issue" action="getAllTeams"/>';
	var GET_CURRENT_SPRINT = '<g:createLink controller="Issue" action="getCurrentSprint"/>';
	var GET_STATUS = '<g:createLink controller="Issue" action="getStatus"/>';
	var GET_MEMBER_OF_TEAM = '<g:createLink controller="Issue" action="getMemberOfTeam"/>';
	
	$(document).ready(function(){			
		getProject(); 
		getAllTeam(); 		   
		});	
	</script>
	</head>
	<body>
	
	<div style="margin:auto; width:90%; text-align: left">
		<span><a href="${createLink(controller:'Issue',action:'listIssue')}" ><img alt="setting" src="../images/skin/list-view.png"> List Issue </a></span>			
	</div>
	<div style="clear:both"></div>
	<h1>CREATE NEW ISSUE</h1>
	
	<div align="center" id="example">
	<select id="team"></select>
	
	</div>
	<div id="formAdd">
<%--	<button id="click" onclick="checkDT('D10T3o');">Click</button>--%>
	<g:form action="addIssue" controller="issue">
	<table cellspacing="0">	
		<tr>
			<td>Project:</td>
			<td>
				<select class="combo-box" id="proselect" onchange="getUserStory(); getMemberOfTeam();"></select>
			</td>
		</tr>   
		<tr>
			<td>User Story:</td>
			<td><select class="combo-box" id="uSselect" name="userStory"></select><span id="s3" style="display: none; color: red;">User Story not null</span></td>
		</tr>
		<tr>
			<td>Sprint:</td>
			<td><input type="text" id="sprint" name="sprint"></td>
		</tr>
		<tr>
			<td>Type:</td>
			<td> <g:select name="type" from="${["User Story","Task","Bug"]}"/></td>
		</tr>
		<tr>
			<td>Subject:</td>
			<td><input type="text" name="subject" required="required"></td>
		</tr>
		<tr>
			<td>Description:</td>
			<td> <g:textArea name="description" rows="5" cols="60" required="required"/></td>
		</tr>
		<tr>
			<td>Status:</td>
			<td><select id="status" name="status"></select> </td>
		</tr>
		<tr>
		<td>Priority:</td>
			<td><g:select name="priority" from="${['Must','Should','Could','Wont']}"  /></td>
		</tr>
		<tr>
			<td>Asigned to:</td>
			<td><select id="assigned" name="assigned"></select> </td>
		</tr>
		<tr>
		<td>Remain:</td>
			<td><input type="text" name="remain" value="D0T0" id="remain"><span id="s1" style="display: none; color: red;">Must be seem D..T..</span></td>
		</tr>
		<tr>
			<td>Estimate:</td>
			<td><input type="text" name="estimate" value="D0T0" id="estimate"><span id="s2" style="display: none;color: red;">Must be seem D..T..</span></td>
		</tr>
	    <tr>
	    	<td colspan="2" align="center"><button id="click" onclick="checkOnClickSubmit();">Create</button></td>
	    </tr>
	</table>
	</g:form>
	</div>		
	</body>
</html>
